import Vue from 'vue';
import Router from 'vue-router';

import { basePath } from './config';

import Shop from '@views/shop/Shop.vue';
import ShopBag from '@views/shop/ShopBag.vue';
import Detail from '@views/shop/Detail';
import Special from '@views/shop/Special';
import ShopOrderDetail from '@views/shop/ShopOrderDetail';
import AfterSaleItemType from '@views/shop/AfterSaleItemType';
import AfterSaleListType from '@views/shop/AfterSaleListType';
import AfterSaleListApply from '@views/shop/AfterSaleListApply';
import AfterSaleItemApply from '@views/shop/AfterSaleItemApply';
import AfterSaleDetail from '@views/shop/AfterSaleDetail';
import ShopChangeAddress from '@views/shop/ShopChangeAddress';
import ShopOrderCancel from '@views/shop/ShopOrderCancel';

import OrderReview from '@views/shop/OrderReview';
import Classify from '@views/shop/Classify';
import Prefecture from '@views/shop/Prefecture';
import OrderList from '@views/shop/OrderList';
import GoodsAfterSaleList from '@views/shop/GoodsAfterSaleList';
import SelectAddress from '@views/shop/SelectAddress';
import EditAddress from '@views/shop/EditAddress';
import Address from '@views/shop/Address';
import OrderDetail from '@views/shop/OrderDetail';

Vue.use(Router);

const router =  new Router({
    mode: 'history',
    base: `${basePath}`,
    routes: [
        {
            path: '/shop',
            name: 'shop',
            component: Shop,
        },
        {
            path: '/shop/changeaddress',
            name: 'shop-changeaddress',
            component: ShopChangeAddress,
        },
        {
            path: '/shop/address',
            name: 'shop-address',
            component: Address,
        },
        {
            path: '/shop/select-address',
            name: 'shop-select-address',
            component: SelectAddress,
        },
        {
            path: '/shop/edit-address',
            name: 'shop-edit-address',
            component: EditAddress,
        },
        {
            path: '/shop/bag',
            name: 'shopbag',
            component: ShopBag,
        },
        {
            path: '/shop-order/list',
            name: 'orderList',
            component: OrderList,
        },
        {
            path: '/shop-order/detail/:orderNumber',
            name: 'orderDetail',
            component: OrderDetail,
        },
        {
            path: '/shop/detail/:goodsId',
            name: 'detail',
            component: Detail,
        },
        {
            path: '/shop/pay-result',
            name: 'detail',
            component: Detail,
        },
        {
            path: '/shop/review',
            name: 'review',
            component: OrderReview,
        },
        {
            path: '/shop/special/:storeId',
            name: 'special',
            component: Special,
        },
        {
            path: '/shop/classify',
            name: 'shopClassify',
            component: Classify,
        },
        {
            path: '/shop/prefecture',
            name: 'shopPrefecture',
            component: Prefecture,
        },
        {
            path: '/shop-order/cancel',
            name: 'shopOrderCancel',
            component: ShopOrderCancel,
        },
        {
            path: '/shop-order/after-sale/select-type-item',
            name: 'after-sale-selectType-item',
            component: AfterSaleItemType,
        },
        {
            path: '/shop-order/after-sale/select-type-list',
            name: 'after-sale-selectType-list',
            component: AfterSaleListType,
        },
        {
            path: '/shop-order/after-sale/apply-item',
            name: 'after-sale-apply-item',
            component: AfterSaleItemApply,
        },
        {
            path: '/shop-order/after-sale/apply-list',
            name: 'after-sale-apply-order',
            component: AfterSaleListApply,
        },
        {
            path: '/shop-order/after-sale/detail/:applyNumber',
            name: 'after-sale-detail',
            component: AfterSaleDetail,
        },
        {
            path: '/shop-order/after-sale/goods-list',
            name: 'goods-after-sale-list',
            component: GoodsAfterSaleList,
        },
    ],
});

export default router;
